var arr = [1,2,3,6,2,7,8];

let index = arr.lastIndexOf(2);
console.log("索引",index);
